<%= content_for :toolbar do %>
  <%= render Alchemy::Admin::ToolbarButton.new(
    icon: 'angle-double-left',
    url: request.referer || alchemy.admin_dashboard_path,
    label: Alchemy.t(:back),
    title: Alchemy.t(:back),
    hotkey: 'alt+z',
    dialog: false,
    skip_permission_check: true
  ) %>
<% end %>

<% content_for(:alchemy_body_class) { 'error' } %>

<%= turbo_frame_tag request.headers["Turbo-Frame"] do %>
  <%= render_message(:error) do %>
    <h1><%= Alchemy.t('An error happened') %></h1>
    <h2>
      <%= @error.class %>
      <%= @notice %>
    </h2>
    <details>
      <summary><%= Alchemy.t('Show error details') %></summary>
      <% @trace.each do |line| %>
        <%= line %><br>
      <% end %>
    </details>
  <% end %>
<% end %>
